package com.huang.constant;

/**
 * @author han
 * @since 2022-01-16 14:31:35
 */
public class Common {

    public static class Token {
        /**
         * token 前缀
         **/
        public final static String TOKEN_HEADER_NAME = "Authorization";
        /**
         * Bearer 认证前缀
         **/
        public final static String BEARER = "Bearer ";
        /**
         * token唯一标识符
         **/
        public static final String JWT_JTI = "jti";
        public static final String JWT_PAYLOAD_KEY = "payload";
        /**
         * 黑名单redis前缀
         **/
        public static final String JWT_JTI_BLACK_PREFIX = "black:jti:";
        /**
         * Basic认证前缀
         **/
        public static final String BASIC_PREFIX = "Basic";
        /**
         * 认证方式
         **/
        public static final String AUTHENTICATION_METHOD = "authenticationMethod";

        /**
         * 刷新
         **/
        public static final String REFRESH_TOKEN_KEY = "refresh_token";
        public static final String GRANT_TYPE_KEY = "grant_type";
    }

    public static class Authority {
        public final static String PREFIX = "ROLE_";
        public final static String JWT_AUTHORITIES_KEY = "authorities";
    }

    public static class SystemConfig {
        public final static String SUPER_ADMIN = "admin";
        public final static String OAUTH_URLS = "oauth:urls";
    }

    public static class Client {
        public final static String CLIENT_ID_KEY = "client_id";
        public final static String ADMIN_CLIENT_ID = "blog-admin-web";
        public final static String APP_ANDROID_CLIENT_ID = "blog-app-android";
        public final static String APP_IOS_CLIENT_ID = "blog-app-ios";
        public final static String APP_WE_CHAT_CLIENT_ID = "blog-app-wechat";
    }

    public static class Login {
        /**
         * 短信验证码key前缀
         **/
        public final static String SMS_CODE_PREFIX = "SMS_CODE:";
    }
}
